package jh.com.jhappbf.model;

import android.os.Parcel;
import android.os.Parcelable;


/**
 * 合同对象
 *
 * @author Administrator
 */
public class ContractModel implements Parcelable {

    private String sepc;
    private String cargoname;
    private String sender;
    private String receiver;
    private String account;
    private String phone;
    private String unit;
    private String amount;
    private String credit;
    private String planId;
    private String types;
    private String money;
    private String price;
    private String memo;
    private String salePerson;
    private String addPerson;

    public ContractModel() {
    }

    private ContractModel(Parcel data) {
        sepc = data.readString();
        cargoname = data.readString();
        sender = data.readString();
        receiver = data.readString();
        account = data.readString();
        phone = data.readString();
        unit = data.readString();
        amount = data.readString();
        credit = data.readString();
        planId = data.readString();
        types = data.readString();
        money = data.readString();
        price = data.readString();
        memo = data.readString();
        salePerson = data.readString();
        addPerson = data.readString();
    }

    public String getAmount() {
        if (amount == null || "null".equals(amount)) {
            amount = "";
        }
        return amount;
    }

    public void setAmount(String amount) {
        this.amount = amount;
    }

    public String getCredit() {
        if (credit == null || "null".equals(credit)) {
            credit = "";
        }
        return credit;
    }

    public void setCredit(String credit) {
        this.credit = credit;
    }

    public String getPlanId() {
        if (planId == null || "null".equals(planId)) {
            planId = "";
        }
        return planId;
    }

    public void setPlanId(String planId) {
        this.planId = planId;
    }

    public String getTypes() {
        if (types == null || "null".equals(types)) {
            types = "";
        }
        return types;
    }

    public void setTypes(String types) {
        this.types = types;
    }


    public String getSepc() {
        if (sepc == null || "null".equals(sepc)) {
            sepc = "";
        }
        return sepc;
    }

    public void setSepc(String sepc) {
        this.sepc = sepc;
    }

    public String getCargoname() {
        if (cargoname == null || "null".equals(cargoname)) {
            cargoname = "";
        }
        return cargoname;
    }

    public void setCargoname(String cargoname) {
        this.cargoname = cargoname;
    }

    public String getSender() {
        if (sender == null || "null".equals(sender)) {
            sender = "";
        }
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public String getReceiver() {
        if (receiver == null || "null".equals(receiver)) {
            receiver = "";
        }
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    public String getAccount() {
        if (account == null || "null".equals(account)) {
            account = "";
        }
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPhone() {
        if (phone == null || "null".equals(phone)) {
            phone = "";
        }
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getUnit() {
        if (unit == null || "null".equals(unit)) {
            unit = "";
        }
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getMoney() {
        if (money == null || "null".equals(money)) {
            money = "0";
        }
        return money;
    }

    public void setMoney(String money) {
        this.money = money;
    }

    public String getPrice() {
        if (price == null || "null".equals(price)) {
            price = "0";
        }
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getMemo() {
        if (memo == null || "null".equals(memo)) {
            memo = "";
        }
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public String getSalePerson() {
        if (salePerson == null || "null".equals(salePerson)) {
            salePerson = "";
        }
        return salePerson;
    }

    public void setSalePerson(String salePerson) {
        this.salePerson = salePerson;
    }

    public String getAddPerson() {
        if (addPerson == null || "null".equals(addPerson)) {
            addPerson = "";
        }
        return addPerson;
    }

    public void setAddPerson(String addPerson) {
        this.addPerson = addPerson;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {

        dest.writeString(sepc);
        dest.writeString(cargoname);
        dest.writeString(sender);
        dest.writeString(receiver);
        dest.writeString(account);
        dest.writeString(phone);
        dest.writeString(unit);
        dest.writeString(amount);
        dest.writeString(credit);
        dest.writeString(planId);
        dest.writeString(types);
        dest.writeString(money);
        dest.writeString(price);
        dest.writeString(memo);
        dest.writeString(salePerson);
        dest.writeString(addPerson);
    }

    public static Creator<ContractModel> CREATOR = new Creator<ContractModel>() {

        @Override
        public ContractModel createFromParcel(Parcel source) {
            return new ContractModel(source);
        }

        @Override
        public ContractModel[] newArray(int size) {
            return new ContractModel[size];
        }
    };

}
